package com.endurance.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.HashMap;

@RestController
@RequestMapping("/ribbon03")
public class Ribbon3Controller {

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping
    public HashMap LoadBalance() {
        HashMap forObject = restTemplate.getForObject("http://PRODUCT/product/findAll", HashMap.class);
        System.out.println(forObject);
        return forObject;
    }


}
